package com.sky.mapper;

import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderMapper {
    //用户下单(day08任务二)
    void insertOrder(Orders orders);

    //用户下单(day08任务二)
    void insertOrderDetails(List<OrderDetail> orderDetailList);

    //订单支付(day08任务三)
    @Select("select * from orders where number = #{orderNumber} and user_id =#{userId}")
    Orders getByNumberAndUserId(@Param("orderNumber") String orderNumber, @Param("userId") Long userId);
    //订单支付(day08任务三)
    void update(Orders orders);
}
